import request from '@/utils/request'

// 获取角色列表
export const getRoleList = (params) => request.get('/sys/role', { params })

// 新增角色
export const addRole = (data) => request.post('/sys/role', data)

// 编辑角色
export const editRole = (data) => request.put(`/sys/role/${data.id}`, data)

// 删除角色
export const delRole = id => request.delete(`/sys/role/${id}`)

// 获取所有角色
export const getRole = () => request.get('/sys/role/list/enabled')

// 获取角色详情
export const roleDetail = id => request.get(`/sys/role/${id}`)

// 分配角色权限
export const perRole = (data) => request.put('/sys/role/assignPrem', data)
